// +----------------------------------------------------------------------
// | SparkShop 坚持做优秀的商城系统
// +----------------------------------------------------------------------
// | Copyright (c) 2022~2099 http://sparkshop.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://opensource.org/licenses/mit-license.php )
// +----------------------------------------------------------------------
// | Author: NickBai
// +----------------------------------------------------------------------

import request from "@/utils/request.js";

export default {
	// 获取砍价列表
	list: {
		get: async function(data = {}) {
			return await request.get('addons/bargain/api.index/index', data);
		}
	},
	// 商品信息
	goods: {
		get: async function(data = {}) {
			return await request.get('addons/bargain/api.goods/detail', data);
		}
	},
	// 砍价
	startBargain: {
		post: async function(data = {}) {
			return await request.post('addons/bargain/api.goods/bargain', data);
		}
	},
	// 获取二维码
	getQrCode: {
		post: async function(data = {}) {
			return await request.post('addons/bargain/api.index/getQrCode', data);
		}
	},
	// 获取商品信息
	goodsInfo: {
		post: async function(data = {}) {
			return await request.post('addons/bargain/api.index/getGoods', data);
		}
	},
	// 订单信息
	getOrderInfo: {
		post: async function(data = {}) {
			return await request.post('addons/bargain/api.order/info', data);
		}
	},
	// 创建订单
	createOrder: {
		post: async function(data = {}) {
			return await request.post('addons/bargain/api.order/createOrder', data);
		}
	}
}